package com.healthcloud.dao;

import com.healthcloud.entity.BusRentEntity;
import com.healthcloud.entity.BusRentEntityVo;
import com.healthcloud.utils.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface BusRentDao extends BaseDao<BusRentEntity> {
	List<BusRentEntity> search(@Param("entity") BusRentEntity entity, @Param("pageParam") PageParam pageParam);

    int count(@Param("entity") BusRentEntity entity);

    int createRent(@Param("entity") BusRentEntity entity);

    int updateBack(@Param("entity") BusRentEntity entity);

    int updateHistory(@Param("entity") BusRentEntity entity);

    BusRentEntity searchById(@Param("id") Long id);

    List<BusRentEntity> searchDue(@Param("entity") BusRentEntity entity, @Param("pageParam") PageParam pageParam);
    
    int countDue(@Param("entity") BusRentEntity entity);

	BusRentEntity searchLastByInstrumentId(@Param("instrumentId") Long instrumentId);

	Map<String, Object> rentCount(@Param("doctorId") Long doctorId);

	List<BusRentEntityVo> searchRentUsers(@Param("entity") BusRentEntity entity, @Param("pageParam") PageParam pageParam);

    List<BusRentEntityVo> searchRentUsers2(BusRentEntity entity, PageParam pageParam);

    Map countTimes(@Param("entity") BusRentEntity entity);

    /**
     * 修改病人身份证号
     * @param oldIdCard 修改前身份证号
     * @param newIdCard 修改后身份证号
     */
    void updateIdCard(@Param("newIdCard") String newIdCard, @Param("oldIdCard") String oldIdCard);
}
